@extends('layouts.tankuang')

@section('content')
    <!--startprint-->
        <form name="add_form" id="add_form" action="{{url('admin/units/add')}}" method="post" enctype="multipart/form-data">
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div id="div_print">
                <h2 class="text-center mg_b36 mg_t25" style="font-weight: bold;">保安公司基本情况登记表</h2>
                <table class="table-form table-border w mg-auto" style="width: 900px">
                    <tbody>
                    <tr>
                        <td class="font-bd" align="center">公司名称</td>
                        <td colspan="5">{{$re->name}}</td>
                        <td rowspan="4" class="text-center" style="width:150px;">
                            @if($re->pic != '')
                                <img src="{{ URL::asset('/') }}{{$re->pic}}" class="img-rounded" alt="" style="width: 190px;border-radius: 0;">
                            @endif
                        </td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">经营范围</td>
                        <td colspan="5">
                            <input type="checkbox"  value="1" name="fanwei[]" @if(in_array(1,$re->fanwei)) checked @endif>&nbsp;门卫&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="2" name="fanwei[]" @if(in_array(2,$re->fanwei)) checked @endif>&nbsp;巡逻&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="3" name="fanwei[]" @if(in_array(3,$re->fanwei)) checked @endif>&nbsp;守护&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="4" name="fanwei[]" @if(in_array(4,$re->fanwei)) checked @endif>&nbsp;押运&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="5" name="fanwei[]" @if(in_array(5,$re->fanwei)) checked @endif>&nbsp;随身护卫&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="6" name="fanwei[]" @if(in_array(6,$re->fanwei)) checked @endif>&nbsp;安全检查<br>
                            <input type="checkbox"  value="7" name="fanwei[]" @if(in_array(7,$re->fanwei)) checked @endif>&nbsp;安全技术防范&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="8" name="fanwei[]" @if(in_array(8,$re->fanwei)) checked @endif>&nbsp;安全风险评估&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="checkbox"  value="9" name="fanwei[]" @if(in_array(9,$re->fanwei)) checked @endif>&nbsp;区域秩序维护
                        </td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">市、区、派出所</td>
                        <td colspan="5">{{getValue($re->city,'area','id','name')}}{{getValue($re->area,'area','id','name')}}{{getValue($re->org_id,'area','id','name')}}</td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">详细地址</td>
                        <td colspan="2">{{$re->address}}</td>
                        <td class="font-bd" align="center">公司住所面积</td>
                        <td>{{$re->mianji}}</td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">企业性质</td>
                        <td colspan="2">
                            {{$re->xingzhi}}
                        </td>
                        <td class="font-bd" align="center">注册资金</td>
                        <td>
                            {{$re->gdzc}}（万元）
                        </td>
                        <td class="font-bd" align="center">保安员人数</td>
                        <td>
                            {{$re->baoan_num_of_peo}}
                        </td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">股东数</td>
                        <td colspan="2">
                            {{$gudong_count}}
                        </td>
                        <td class="font-bd" align="center">联系人</td>
                        <td>
                            {{$re->lianxiren}}
                        </td>
                        <td class="font-bd" align="center">联系电话</td>
                        <td>
                            {{$re->phone}}
                        </td>
                    </tr>

                    @if($gudong_count)
                        <tr>
                            <td class="font-bd" align="center" rowspan="{{$gudong_count+1}}">主要股东</td>
                            <td class="font-bd" align="center">姓名</td>
                            <td class="font-bd" align="center">性别</td>
                            <td class="font-bd" align="center" colspan="2">证件号码</td>
                            <td class="font-bd" align="center">出资金额</td>
                            <td class="font-bd" align="center">出资比例</td>
                        </tr>

                        @foreach($gudong as $k=>$v)
                            <tr>
                                <td class="font-bd" align="center">{{$v->name}}</td>
                                <td class="font-bd" align="center">{{$v->sex}}</td>
                                <td class="font-bd" align="center" colspan="2">{{$v->id_number}}</td>
                                <td class="font-bd" align="center">{{$v->jine}}</td>
                                <td class="font-bd" align="center">{{$v->bili}}</td>
                            </tr>
                        @endforeach
                    @endif

                    @if($guanli_count)
                        <tr>
                            <td class="font-bd" align="center" rowspan="{{$guanli_count+1}}">主要管理人员</td>
                            <td class="font-bd" align="center">姓名</td>
                            <td class="font-bd" align="center">性别</td>
                            <td class="font-bd" align="center">文化程度</td>
                            <td class="font-bd" align="center">职务</td>
                            <td class="font-bd" align="center">身份证号码</td>
                            <td class="font-bd" align="center">联系电话</td>
                        </tr>
                        @foreach($guanli as $k=>$v)
                        <tr>
                            <td class="font-bd" align="center">{{$v->name}}</td>
                            <td class="font-bd" align="center">{{$v->sex}}</td>
                            <td class="font-bd" align="center">{{$v->education}}</td>
                            <td class="font-bd" align="center">{{$v->position}}</td>
                            <td class="font-bd" align="center">{{$v->id_number}}</td>
                            <td class="font-bd" align="center">{{$v->phone}}</td>
                        </tr>
                        @endforeach
                    @endif

                    <tr>
                        <td class="font-bd" align="center" rowspan="2">从事武装守护押运服务人员设备情况</td>
                        <td class="font-bd" align="center">守护押运人数</td>
                        <td class="font-bd" align="center">枪支型号及数量</td>
                        <td class="font-bd" align="center">子弹数量</td>
                        <td class="font-bd" align="center">押运专用车辆数</td>
                        <td class="font-bd" align="center">通讯设备型号及数量</td>
                        <td class="font-bd" align="center">报警设备型号及数量</td>
                    </tr>
                    <tr>
                        <td class="font-bd" align="center">{{$re->yayunrenshu}}</td>
                        <td class="font-bd" align="center">{{$re->qiangzhi}}</td>
                        <td class="font-bd" align="center">{{$re->zidan}}</td>
                        <td class="font-bd" align="center">{{$re->yayunche}}</td>
                        <td class="font-bd" align="center">{{$re->tongxun}}</td>
                        <td class="font-bd" align="center">{{$re->baojing}}</td>
                    </tr>
                    </tbody>
                </table>
                <!--endprint-->
                {{--<div class="w1000 wbt mg_t25 mg_b18">
                    <span class="font-bd">填报单位：</span>
                    <input type="text" class="w250 input_bottom dsp" name="tbdw">
                    <span class="itv"></span>
                    <span class="font-bd">填报人：</span>
                    <input type="text" class="w250 input_bottom dsp" name="tbr">
                </div>--}}

                <div class="w wbt mg_t25 pd_b20 text-center" style="width: 900px">
                    <a id="goToPageB" class="easyui-linkbutton dsp print" data-options="iconCls:'icon-print'" onclick="doPrint()">打印</a>
                </div>
            </div>
        </form>



        <script type="text/javascript">
            function doPrint() {
                bdhtml=window.document.body.innerHTML;
                sprnstr="<!--startprint-->";
                eprnstr="<!--endprint-->";
                prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
                prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
                window.document.body.innerHTML=prnhtml;
                window.print();
            }
        </script>
@stop